from docx import Document
def searchAndReplace(data,name_select):
    for item in data:
        document=Document('template.docx')
        for key in item:
            print(key,item[key])
            for paragraph in document.paragraphs:
                for run in paragraph.runs:
                    if key in run.text:
                        try:
                            temp = round(item[key])
                        except:
                            temp = item[key]
                        print("找到了"+key+",正在替换成"+str(temp))
                        run.text=run.text.replace(key,str(temp))
        document.save("out/"+item[name_select]+'.docx')